<script setup>
/*
生命周期:
vue2
  创建期
     beforeCreate
     created
  渲染期
     beforeMount
     mounted
  更新期
     beforeUpdate
     updated
  销毁期
     beforeDestroyed
     destroyed
  缓存期
     activated
     dactivated
vue3
  1:setup替代了beforeCreate created
  2:其它钩子都加了on,都需要导入再使用
  3:beforeDestroyed  ==> onBeforeUnmount
    destroyed        ==> onUnmounted
  4:vue2的生命周期都只有一个函数执行，
    vue3除了setup,其它函数都可以有多个函数执行

vue3生命周期用法
    setup直接使用
      setup(){}
      script setup 语法糖
    其它钩子：
       1：import {onMounted} from 'vue'
       2:定义
         onMounted(()=>{
          ....
         })
         onMounted(()=>{
          ....
         })
         onMounted(()=>{
          ....
         })

*/

import { onMounted } from 'vue'

onMounted(() => {
  console.log('onMounted:1')
})
onMounted(() => {
  console.log('onMounted:2')
})
onMounted(() => {
  console.log('onMounted:3')
})
onMounted(() => {
  console.log('onMounted:4')
})
</script>

<template>
  <div class="app-page">app</div>
</template>

<style scoped></style>
